it("should allow empty urls", () => {
	const url = new URL("data:,", import.meta.url);
	expect(url.href).toBe("data:,");
	expect(url.protocol).toBe("data:");
	expect(url.pathname).toBe(",");
});

it("should allow empty urls with mimetype", () => {
	const url = new URL("data:test,", import.meta.url);
	expect(url.href).toBe("data:test,");
	expect(url.protocol).toBe("data:");
	expect(url.pathname).toBe("test,");
});

it("should allow data urls with mimetype", () => {
	const url = new URL(
		"",
		import.meta.url
	);
	expect(url.protocol).toBe("data:");
	expect(url.href).toMatch(/^data:image\/svg\+xml;base64,/);
});

it("should allow data urls with mimetype mapped to rules", () => {
	const url = new URL(
		"",
		import.meta.url
	);
	expect(url.href).toMatch(/^https:\/\/test\.cases\/path\/[a-f0-9]+\.svg$/);
});
